package com.chenl.provider.util;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;

public class SnowFlakeUtil {
    private static final Long workerId = RandomUtil.randomLong(31);
    private static final Long dataCenterId = RandomUtil.randomLong(31);
    private static final Snowflake SNOWFLAKE = IdUtil.getSnowflake(workerId, dataCenterId);

    public static String next() {
        return String.valueOf(SNOWFLAKE.nextId());
    }

    public static Long nextId() {
        return SNOWFLAKE.nextId();
    }



}
